<template>
  <div class="footerIndex">
    <div class="footerIndexMain displayFlex">
      <div class="footerIndexLeft">
        <section><img :src="footerLogoIcon" alt=""></section>
        <section>
          <p>平台郑重提示：</p>
          <p>彩票有风险，投注需谨慎！不向未满18周岁的青少年出售彩票</p>
        </section>
      </div>
      <div class="footerIndexRight">
        <section>
          <p>￥<span>{{footerData.money||'0.00'}}</span>今日已实兑奖</p>
        </section>
        <section>
          <p><span>{{footerData.onlineNum||'4000'}}</span>在线人数</p>
        </section>
      </div>
    </div>
  </div>
</template>

<script>
  import './footer.scss';
  import { mapState } from 'vuex';
  export default {
    data() {
      return {
        footerLogoIcon: require('../../assets/images/footer/footerLogo.png'),
        footerData: {}, // 兑奖金额
      }
    },
    computed: {
      ...mapState({
        footerInfo: state => state.mutations.prize,
      })
    },
    activated() {
      this.initData();
    },
    mounted() {

    },
    methods: {
      initData() {
        let that = this;
        that.footerData = that.footerInfo||{};
        if(JSON.stringify(that.footerData)=='{}'){
          that.getFooterData();
        }
      },
      getFooterData() {
        let that = this;
        // 中奖金额
        that._Util.post(that, that._Api.POST_GET_MONEY_DATA, {}, (data) => {
          that.$store.commit('PRIZE', data);
          that.$store.commit('FG_GAME_STATUS', parseInt(data.fgGameStatus));
        },'','',true);
      },
    },
    components: {},
    watch: {
      'footerInfo'() {
        this.initData();
      }
    }
  }
</script>

<style lang="css" rel="styleheet/css">

</style>
